<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*"%>
<%@page import="model.News"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %><%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- includes -->
<%@ include file="../includes/includes.jsp"%>
<!-- fin includes -->
<script type=”text/javascript”
	src=”http://code.jquery.com/jquery-latest.js”></script>

<script type="text/javascript">
	function cambia() {
		alert("cambia");
		$("h4").css("background-color", "red");

	}
</script>
<title>JSPBlog search ....</title>
</head>
<body>

<!-- cabecera -->
<%@ include file="../includes/header.jsp"%>
<!-- fin cabecera -->

<div id="main">
<div class="article">
<table height="136" border="0" cellpadding="0" cellspacing="0">
	<tbody>
		<tr>
			<td class="menu" valign="top"><a href="#TOP"></a> <!-- contenido central -->

			<%
				//   Connection c = null;
				String body = "";
				String tittle = "";
				String author = "";
				String date = "";

				String busqueda = (String) request.getParameter("q");
				Integer id = Integer.parseInt(request.getParameter("q"));
				
				News n = new News().getNewsbyId(id);
				tittle = n.getTittle();
				date = n.getDate();
				author = n.getAuthor();
				body = n.getBody();
			%>
			<div class="article">
			<form method="post" action="editnews2.jsp">
			<table border='0' cellpadding="0" align="center" style="width: 636px; height: 364px;">
				<tr>
					<td><b><input type="text" id="tittle" name="tittle" value="<%=tittle%>"></input></b>
					<input type="hidden" id="q" name="q" value="<%= id %>"></input>
					</td>
				</tr>
				<!-- 
				<tr>
					<td>
					<textarea name="body" rows='24' cols="100"><%=body%></textarea>
					</td>
				</tr>
				-->
					<tr>
	   <td colspan="2" style="height:300px;">
	   <FCK:editor instanceName="EditorDefault" width="600px" height="400px">
				<jsp:attribute name="value">
				<%= body %>
				</jsp:attribute>
				
			</FCK:editor>
	    </td>	
				<tr>
			    <tr>
					<td><b><%=date%></b></td>
				</tr>
				<tr>
					<td><i><%=author%></i></td>
				</tr>
				<td>
				  <input type="submit" value="Save">
				  </td>
				</tr>
			</table>
			</form>
			</div>
			<br />
			<hr>
			</hr>
	<!-- fin contenido central --></td>
		</tr>
	</tbody>
</table>

</div>
</div>


<!-- menu  -->
<%@ include file="../includes/menu.jsp"%>
<!--  fin menu  -->

<!-- footer  -->
<%@ include file="../includes/footer.jsp"%>
<!--  fin footer -->

</body>
</html>
